import request from '@/utils/request'

/**
 * 销售额卡片零散数据
 * @param  biProjectCode  项目code
 * @param  timeType  日 月 年
 * @param  dataTime  更新日期，接口获取的
 */
const querySaleCardApi = ({ biProjectCode, timeType, dataTime }) => {
	const data = {
		biProjectCode,
		timeType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/sale/querySaleCard',
		method: 'post',
		data: data
	})
};

/**
 * 销售额卡片柱状图
 * @param  biProjectCode  项目code
 * @param  timeType  日 月 年
 * @param  dataTime  更新日期，接口获取的
 */
const queryNewSaleChartApi = ({ biProjectCode, timeType, dataTime }) => {
	const data = {
		biProjectCode,
		timeType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/sale/queryNewSaleChart',
		method: 'post',
		data: data
	})
};

/**
 * 客流量卡片零散数据
 * @param  biProjectCode  项目code
 * @param  timeType  日 月 年
 * @param  dataTime  更新日期，接口获取的
 */
const queryFlowCardApi = ({ biProjectCode, timeType, dataTime }) => {
	const data = {
		biProjectCode,
		timeType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/flow/queryFlowCard',
		method: 'post',
		data: data
	})
};

/**
 * 客流量卡片柱状图
 * @param  biProjectCode  项目code
 * @param  timeType  日 月 年
 * @param  dataTime  更新日期，接口获取的
 */
const queryFlowChartApi = ({ biProjectCode, timeType, dataTime }) => {
	const data = {
		biProjectCode,
		timeType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/flow/queryFlowChart',
		method: 'post',
		data: data
	})
};

/**
 * 出租情况卡片基本数据
 * @param  biProjectCode  项目code
 * @param  dataTime  更新日期，接口获取的
 */
// const rentCardApi = ({ biProjectCode, dataTime }) => {
// 	// const data = {
// 	// 	biProjectCode,
// 	// 	dataTime,
// 	// }
// 	return request({
// 		url: `/portal-server/v1/api/rent/rentCard?biProjectCode=${biProjectCode}&dataTime=${dataTime}`,
// 		method: 'get',
// 		// data: data
// 	})
// };

/**
 * 出租情况卡片表格数据
 * @param  biProjectCode  项目code
 * @param  dataTime  更新日期，接口获取的
 */
// const rentInformationApi = ({ biProjectCode, dataTime }) => {
// 	// const data = {
// 	// 	biProjectCode,
// 	// 	dataTime,
// 	// }
// 	return request({
// 		url: `/portal-server/v1/api/rent/rentInformation?biProjectCode=${biProjectCode}&dataTime=${dataTime}`,
// 		method: 'get',
// 		// data: data
// 	})
// };

/**
 * 出租情况卡片判断是否为多楼栋
 * @param  biProjectCode  项目code
 */
const isBuildingsApi = ({ biProjectCode }) => {
	// const data = {
	// 	biProjectCode,
	// }
	return request({
		url: `/portal-server/v1/api/rent/isBuildings?biProjectCode=${biProjectCode}`,
		method: 'get',
		// data: data
	})
};

/**
 * 出租分析卡片
 * @param  biProjectCode  项目code
 * @param  dataType  出租，空置
 * @param  dataTime  更新日期，接口获取的
 */
 const rentOutCardApi = ({ biProjectCode, dataType, dataTime }) => {
	const data = {
		biProjectCode,
		dataType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/rentout/rentOutCard',
		method: 'post',
		data: data
	})
};

/**
 * 出租分析卡片下列表
 * @param  biProjectCode  项目code
 * @param  dataType  出租，空置
 * @param  dataTime  更新日期，接口获取的
 */
 const rentOutCardListApi = ({ biProjectCode, dataType, dataTime }) => {
	const data = {
		biProjectCode,
		dataType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/rentout/rentOutCardList',
		method: 'post',
		data: data
	})
};



/**
 * 房态图：卡片是否显示
 * @param  biProjectCode  项目code
 */
 const roomRackisShowApi = ({ biProjectCode }) => {
	// const data = {
	// 	biProjectCode,
	// }
	return request({
		url: `/portal-server/v1/api/mapping/roomRackisShow?biProjectCode=${biProjectCode}`,
		method: 'get',
		// data: data
	})
};

/**
 * 新签情况卡片基本数据
 * @param  biProjectCode  项目code
 * @param  dataTime  更新日期，接口获取的
 * @param  timeType  	时间类型：月，年
 */
 const queryContractPriceCardApi = ({ biProjectCode, dataTime, timeType }) => {
	const data = {
		biProjectCode,
		dataTime,
		timeType
	}
	return request({
		url: 'portal-server/v1/api/contract/queryContractPriceCard',
		method: 'post',
		data: data
	})
};

/**
* 新签情况卡片下列表
* @param  biProjectCode  项目code
* @param  dataTime  更新日期，接口获取的
* @param  timeType  	时间类型：月，年
*/
const queryContractPriceChartApi = ({ biProjectCode, dataTime, timeType }) => {
	const data = {
		biProjectCode,
		dataTime,
		timeType
	}
	return request({
		url: 'portal-server/v1/api/contract/queryContractPriceChart',
		method: 'post',
		data: data
	})
};

/**
 * 新签情况新签情况卡片基本数据
 * @param  biProjectCode  项目code
 * @param  dataTime  更新日期，接口获取的
 * @param  timeType  	时间类型：月，年
 */
const queryNewRentCardApi = ({ biProjectCode, dataTime, timeType }) => {
	const data = {
		biProjectCode,
		dataTime,
		timeType
	}
	return request({
		url: '/portal-server/v1/api/new/rentCard',
		method: 'post',
		data: data
	})
};

/**
* 新签情况新签情况卡片下列表
* @param  biProjectCode  项目code
* @param  dataTime  更新日期，接口获取的
* @param  timeType  	时间类型：月，年
*/
const queryNewSignatureInformationApi = ({ biProjectCode, dataTime, timeType }) => {
	const data = {
		biProjectCode,
		dataTime,
		timeType
	}
	return request({
		url: '/portal-server/v1/api/new/newSignatureInformation',
		method: 'post',
		data: data
	})
};

/**
* 欠款分析卡片基本数据
* @param  projectCode  项目code
* @param  timeType  	时间类型：当年，历史，全部
*/
const queryDeptCardApi = ({ projectCode, timeType }) => {
	const data = {
		projectCode,
		timeType
	}
	return request({
		url: '/portal-server/v1/api/cockpitArrears/queryCardInfo',
		method: 'post',
		data: data
	})
};

/**
* 欠款分析卡片下列表
* @param  projectCode  项目code
* @param  timeType  	时间类型：当年，历史，全部
*/
const queryDaptInformationApi = ({ projectCode, timeType }) => {
	const data = {
		projectCode,
		timeType
	}
	return request({
		url: '/portal-server/v1/api/cockpitArrears/queryChartInfo',
		method: 'post',
		data: data
	})
};

/**
* 【保证金押金】卡片基本数据
* @param  biProjectCode  项目code
* @param  chargeclass  	保证金/押金
*/
const manageGuaranteeCardApi = ({ biProjectCode, chargeclass }) => {
	const data = {
		biProjectCode,
		chargeclass,
	}
	return request({
		url: '/portal-server/v1/api/guarantee/manageGuaranteeCard',
		method: 'post',
		data: data
	})
};

/**
* 保证金押金卡片下列表
* @param  biProjectCode  项目code
* @param  chargeclass  	保证金/押金
*/
const manageGuaranteeCardListApi = ({ biProjectCode, chargeclass }) => {
	const data = {
		biProjectCode,
		chargeclass,
	}
	return request({
		url: '/portal-server/v1/api/guarantee/manageGuaranteeCardList',
		method: 'post',
		data: data
	})
};

/**
 * 资本化改造卡片 是否显示
 * @param  biProjectCode  项目code
 */
 const queryCipLabApi = ({ biProjectCode }) => {
	// const data = {
	// 	biProjectCode,
	// }
	return request({
		url: `/portal-server/v1/api/cip/queryCipLab?biProjectCode=${biProjectCode}`,
		method: 'get',
		// data: data
	})
};
/**
 * 资本化改造卡片
 * @param  biProjectCode  项目code
 * @param  dataType 计划，成本
 * @param  dataTime  更新日期，接口获取的
 */
const queryCipCardApi = ({ biProjectCode, dataType, dataTime }) => {
	const data = {
		biProjectCode,
		dataType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/cip/queryCipCard',
		method: 'post',
		data: data
	})
};
/**
 * 资本化改造列表
 * @param  biProjectCode  项目code
 * @param  dataType 计划，成本
 * @param  dataTime  更新日期，接口获取的
 */
const queryCipFormApi = ({ biProjectCode, dataType, dataTime }) => {
	const data = {
		biProjectCode,
		dataType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/cip/queryCipForm',
		method: 'post',
		data: data
	})
};
/**
 * 【预算达成】列表
 * @param  biProjectCode  项目code
 * @param  dataType 月度，累计，全年
 * @param  dataTime  数据日期（日期类型：yyyy-MM）
 */
const budgetCardListApi = ({ biProjectCode, dataType, dataTime }) => {
	const data = {
		biProjectCode,
		dataType,
		dataTime,
	}
	return request({
		url: '/portal-server/v1/api/budget/budgetCardList',
		method: 'post',
		data: data
	})
};
/**
* 【投资联营】-项目是否有自营联营门店,0:无自营联营-隐藏；1: 有自营联营-显示
* @param  biProjectCode  项目code
*/
const queryInvestPooLabApi = ({ biProjectCode }) => {
	// const data = {
	// 	biProjectCode,
	// }
	return request({
		url: `/portal-server/v1/api/investPool/queryInvestPooLab?biProjectCode=${biProjectCode}`,
		method: 'get',
		// data: data
	})
};
/**
* 【投资联营】-卡片+图表
* @param  biProjectCode  项目code
* @param  dataTime  数据日期
* @param  muCode  门店编码
* @param  timeType  时间类型：日，月，年
*/
const queryInvestPoolApi = ({ biProjectCode, dataTime, muCode, timeType }) => {
	const data = {
		biProjectCode,
		dataTime,
		muCode,
		timeType
	}
	return request({
		url: '/portal-server/v1/api/investPool/queryInvestPool',
		method: 'post',
		data: data
	})
};

/**
* 【两书对标】-是否显示card
* @param  biProjectCode  项目code
*/
const queryTwoBooksLabApi = ({ biProjectCode }) => {
	// const data = {
	// 	biProjectCode,
	// }
	return request({
		url: `/portal-server/v1/api/twoBooks/queryTwoBooksLab?biProjectCode=${biProjectCode}`,
		method: 'get',
		// data: data
	})
};

/**
* 【两书对标】-card表格数据
* @param  biProjectCode  项目code
*/
const queryHomePageListApi = ({ biProjectCode }) => {
	// const data = {
	// 	biProjectCode,
	// }
	return request({
		url: `/portal-server/v1/api/twoBooks/queryHomePageList?biProjectCode=${biProjectCode}`,
		method: 'get',
		// data: data
	})
};

/**
 * 【工单监控】卡片图标
 * @param processStatus 流程状态:[25]-延期进行,[20]-正常进行,[99,100,105]-已完成
 * @param projectKey 项目code
 * @param pageKey 菜单权限返回的pageurl
 */
const queryWorkOrderDashboardCollectApi = (data) => {
	return request({
		url: '/workOrderApp/app/workOrder/monitor/collect',
		method: 'post',
		data: data
	})
};
/**
 * 驾驶舱新版工单运营监控-汇总
 *
 * @param processType  	工单类型服务类-0,审批类-1
 * @param projectKey 项目code
 * @param pageKey 菜单权限返回的pageurl
 */
const getWorkOrderDashboardCollectListApi = (data) => {
	return request({
		url: '/workOrderApp/app/workOrder/monitor/collectList',
		method: 'post',
		data: data
	})
};

/**
 * 【品牌分析】卡片
 * @param biProjectCode
 */
 const brandCardListApi = (data) => {
	return request({
		url: '/portal-server/v1/api/brand/brandCardList',
		method: 'post',
		data: data
	})
};

/**
 * 【品牌分析】卡片 - 楼层列表
 * @param biProjectCode
 */
 const brandCardFloorListApi = (data) => {
	return request({
		url: '/portal-server/v1/api/brand/brandCardFloorList',
		method: 'post',
		data: data
	})
};

/**
 * 【品牌分析】卡片 - 业态列表
 * @param biProjectCode
 */
 const brandCardFormatListApi = (data) => {
	return request({
		url: '/portal-server/v1/api/brand/brandCardFormatList',
		method: 'post',
		data: data
	})
};


/**
 * 【两算一控】卡片 - 
 * @param biProjectCode
 */
const queryTwoCalculateCardApi = (data) => {
	return request({
		url: `/portal-server/v1/api/calculagte/queryTwoCalculateCard?biProjectCode=${data.biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【两算一控】card表格数据 - 
 * @param biProjectCode
 */
const queryTwoCalculateChartApi = (data) => {
	return request({
		url: `/portal-server/v1/api/calculagte/queryTwoCalculateChart?biProjectCode=${data.biProjectCode}`,
		method: 'get'
	})
};
/**
 * 【能源费】卡片 - 
 * @param biProjectCode
 */
const queryEnergyModuleCardListApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/report/energyModuleCardList?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【能源费】card表格数据 - 
 * @param biProjectCode
 */
const queryEnergyModuleChartListApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/report/energyModuleChartList?biProjectCode=${biProjectCode}`,
		method: 'get'
	})
};
/**
 * 【费控标准】card表格数据 - 
 * @param biProjectCode
 */
const queryCostControlStandardListApi = ({biProjectCode, bizType}) => {
	return request({
		url: `/portal-server/v1/api/calculagte/queryCostControlCard?biProjectCode=${biProjectCode}&bizType=${bizType}`,
		method: 'get'
	})
};

// 【库房 | 场地 | 广告 | 中岛位】卡片 - 
const leaseCardApi = (biProjectCode,propertytypename,time) => {
	return request({
		url: `/portal-server/v1/api/rental/rentalCard?biProjectCode=${biProjectCode}&propertytypename=${propertytypename}&time=${time}`,
		method: 'get',
	})
};

// 【库房 | 场地 | 广告 | 中岛位】chart - 
const leaseChartApi = (biProjectCode,propertytypename,time) => {
	return request({
		url: `/portal-server/v1/api/rental/rentalChart?biProjectCode=${biProjectCode}&propertytypename=${propertytypename}&time=${time}`,
		method: 'get',
	})
};

// 【库房 | 场地 | 广告 | 中岛位】出租明细
const leaseDetailApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/pcRentalInfo`,
		method: 'post',
		data: data
	})
};

// 【库房 | 场地 | 广告 | 中岛位】出租明细 - 导出
const leaseExportApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/pcRentalExport`,
		method: 'post',
		data: data,
		responseType: 'blob'
	})
};

// 品牌
const brandListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/brandnamDown`,
		method: 'post',
		data: data
	})
};

// 资产类型
const propertyTypeListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/propertytypenameDown`,
		method: 'post',
		data: data
	})
};

// 楼栋
const buildingListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/buildingDown`,
		method: 'post',
		data: data
	})
};

// 楼层
const floorListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/floorDown`,
		method: 'post',
		data: data
	})
};

// 租赁状态
const rentalStatusListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/rentalStatusDown`,
		method: 'post',
		data: data
	})
};

// 合同状态
const contractStatusListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/contractsstatusDown`,
		method: 'post',
		data: data
	})
};

// 商户类型
const customerTypeListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/rental/customertypeDown`,
		method: 'post',
		data: data
	})
};

/**
 * 【整场测算】卡片基本数据
 */
const queryCalculateCardListApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/calculate/queryCalculateCardList?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【整场测算】图表数据
 */
const queryCalculateChartListApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/calculate/queryCalculateChartList?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【巡检监控】卡片基本数据
 */
const queryInspectionMonitoryCardListApi = (data) => {
	return request({
		url: `/property-portal/v1/api/inspectionMonitoring/queryInspectionRouteDetail`,
		method: 'post',
		data: data
	})
};

/**
 * 品牌监控
 */
 export const brandMonitoringListApi = (projectCode) => {
	return request({
		url: `/portal-server/v1/api/brandMonitoring/card?projectCode=${projectCode}`,
		method: 'get',
	})
};
/**
 * 租售比
 */
export const highTentalToSalesRatioCardApi = (projectCode) => {
	return request({
		url: `/portal-server/v1/api/brandMonitoring/highTentalToSalesRatioCard?projectCode=${projectCode}`,
		method: 'get',
	})
};

/**
 * 【设备维保】卡片
 */
const equipmentMaintenCardListApi = (data) => {
	return request({
		url: `/property-portal/v1/api/deviceMaintenance/queryDeviceMaintenance`,
		method: 'post',
		data: data
	})
};

/**
 * 【车场白名单】卡片基本数据
 */
export const carParkCardApi = (data) => {
	return request({
		url: `/portal-server/v1/api/carPark/card`,
		method: 'post',
		data: data
	})
};

/**
 * 【车场白名单】卡片table数据
 */
export const carParkFormApi = (data) => {
	return request({
		url: `/portal-server/v1/api/carPark/form`,
		method: 'post',
		data: data
	})
};

/**
 * 【抬杆异常】卡片-基本数据
 */
 export const abnormalCardApi = (data) => {
	return request({
		url: `/portal-server/v1/api/abnormal/card`,
		method: 'post',
		data: data
	})
};

/**
 * 【抬杆异常】卡片-车牌表单
 */
 export const abnormalFormApi = (data) => {
	return request({
		url: `/portal-server/v1/api/abnormal/form`,
		method: 'post',
		data: data
	})
};

/**
 * 【抬杆异常】卡片-月度图表
 */
 export const abnormalChartApi = (data) => {
	return request({
		url: `/portal-server/v1/api/abnormal/chart`,
		method: 'post',
		data: data
	})
};

// 费控分析酒寓卡片列表
const costAnalysisHotelCardListApi = (data) => {
	return request({
		url: `/budget/hotelCost/costAnalysisCard?projectCode=${data.projectCode}`,
		method: 'get',
	})
};
// 费控分析商办产卡片列表
const costAnalysisBusinessCardListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/calculagte/queryCostControlNewCard?biProjectCode=${data.biProjectCode}&bizType=${data.bizType}`,
		method: 'get',
	})
};

// 经营项目详情-收缴率-卡片
const collectionRateCardListApi = (data) => {
	return request({
		url: `/portal-server/v1/api/arrearsStatistics/arrearsStatisticsCard`,
		method: 'post',
		data
	})
};

export default {
	querySaleCardApi,
	queryNewSaleChartApi,
	queryFlowCardApi,
	queryFlowChartApi,
	// rentCardApi,
	// rentInformationApi,
	isBuildingsApi,
	rentOutCardApi,
	rentOutCardListApi,
	roomRackisShowApi,
	queryContractPriceCardApi,
	queryContractPriceChartApi,
	queryNewRentCardApi, //新签卡片
	queryWorkOrderDashboardCollectApi, //工单卡片
	queryNewSignatureInformationApi, //新签卡片卡片下面列表
	queryDeptCardApi, //欠款分析
	queryDaptInformationApi, // 欠款分析卡片下列表
	manageGuaranteeCardApi,//保证金押金
	manageGuaranteeCardListApi,// 保证金押金卡片下列表
	queryCipLabApi, // 经营-商业-资本化改造卡片 是否显示
	queryCipCardApi, // 查询经营-商业-资本化改造卡片
	queryCipFormApi, //商业-资本化改造表单
	budgetCardListApi, //【预算达成】列表
	queryInvestPooLabApi, //【投资联营】-项目是否有自营联营门店,0:无自营联营-隐藏；1: 有自营联营-显示
	queryInvestPoolApi, //【投资联营】卡片+图表
	queryTwoBooksLabApi, // 【两书对标】-是否显示card
	queryHomePageListApi, //【两书对标】-card表格数据
	brandCardListApi,
	brandCardFloorListApi,
	brandCardFormatListApi,
	queryTwoCalculateCardApi, //两算一控卡片
	queryTwoCalculateChartApi, //两算一控 图标
	queryEnergyModuleCardListApi, //能源费 卡片
	queryEnergyModuleChartListApi, //能源费 图表
	queryCostControlStandardListApi, //费控标准 卡片
	leaseCardApi, //多经出租卡片
	leaseChartApi, //多经出租图表
	leaseDetailApi, //多经出租明细
	leaseExportApi, //多经出租明细-导出
	brandListApi,
	propertyTypeListApi,
	buildingListApi,
	floorListApi,
	rentalStatusListApi,
	contractStatusListApi,
	customerTypeListApi,
	queryCalculateCardListApi, // 整场测算卡片
	queryCalculateChartListApi, // 整场测算图表
	getWorkOrderDashboardCollectListApi, // 驾驶舱工单监控新改版
	queryInspectionMonitoryCardListApi, //【巡检监控】卡片基本数据
	equipmentMaintenCardListApi, // 【设备维保】卡片
	costAnalysisHotelCardListApi,
	costAnalysisBusinessCardListApi,
	collectionRateCardListApi
}
